<div class="content-section introduction">
    <div class="feature-intro">
        <h1>Tree <span>Filter</span></h1>
        <p>Filtering updates the node based on the constraints.</p>
    </div>
</div>

<div class="content-section implementation">
    <div class="card">
        <h5>Lenient Filter Mode</h5>
        <p-tree [value]="files1" [filter]="true"></p-tree>

        <h5>Strict Filter Mode</h5>
        <p-tree [value]="files2" [filter]="true" filterMode="strict"></p-tree>
    </div>
</div>

<div class="content-section documentation">
    <p-tabView>
        <p-tabPanel header="Source">
            <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/tree" class="btn-viewsource" target="_blank">
                <span>View on GitHub</span>
            </a>
            <a href="https://stackblitz.com/edit/primeng-treefilter-demo" class="btn-viewsource" style="margin-left: .5em;" target="_blank">
                <span>Edit in StackBlitz</span>
            </a>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;h3&gt;Lenient Filter Mode&lt;/h3&gt;
&lt;p-tree [value]="files1" [filter]="true"&gt;&lt;/p-tree&gt;

&lt;h3&gt;Strict Filter Mode&lt;/h3&gt;
&lt;p-tree [value]="files2" [filter]="true" filterMode="strict"&gt;&lt;/p-tree&gt;
</app-code>
<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
import &#123;Component,OnInit&#125; from '@angular/core';
import &#123;NodeService&#125; from '../../service/nodeservice';
import &#123;TreeNode&#125; from 'primeng/api';

@Component(&#123;
    templateUrl: './treefilterdemo.html'
&#125;)
export class TreeFilterDemo implements OnInit &#123;

    files1: TreeNode[];

    files2: TreeNode[];
    
    constructor(private nodeService: NodeService) &#123; &#125;

    ngOnInit() &#123;
        this.nodeService.getFiles().then(files => this.files1 = files);
        this.nodeService.getFiles().then(files => this.files2 = files);
    &#125;
&#125;
</app-code> 
        </p-tabPanel>
        <p-tabPanel header="StackBlitz">
            <ng-template pTemplate="content">
                <iframe src="https://stackblitz.com/edit/primeng-treefilter-demo?embed=1" style="width: 100%; height: 768px; border: none;"></iframe>
            </ng-template>
        </p-tabPanel>
    </p-tabView>
</div>